package com.aaa.marketresearch.dataresource.service;

import com.aaa.marketresearch.dataresource.dao.MarketDAO;
import com.aaa.marketresearch.dataresource.domain.Market;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;

/**
 * @author Nail
 */
@Service
public class MarketServiceImpl implements MarketService{

    @Autowired
    private MarketDAO marketDAO;

    @Override
    public List<Market> getAll() {
        return marketDAO.getAll();
    }

    @Override
    public Market getById(Integer id) {
        return marketDAO.getById(id);
    }

    @Transactional
    @Override
    public void save(Market market) {
        marketDAO.save(market);
    }

    @Transactional
    @Override
    public boolean delete(Integer id) {
        return marketDAO.delete(id);
    }
}
